<?php
/*****
Template Name: 专题模版
******/
get_header();
?>
<div class="large left">
  <div class="spc_list">
    <div class="hd">
      <div class="hdt">专题列表</div>
<!--      <div id="sp_order" class="rt"> 
        <a href="/list/sp.html?order=bangumi" class="ckc">番剧</a>
        <a href="/list/sp.html?order=new" class="ckc">投稿顺序</a>
        <a href="/list/sp.html?order=attention" class="ckc">关注数</a>
        <a href="/list/sp.html?order=lastupdate" class="ckc on">更新日期</a>
       </div>
-->    </div>
    <ul>
	   <?php 
        $cslug = $val->slug;  $cname = $val->name; $cid = $val->cat_ID;
        $args = array(
           'numberposts' => 5,
           'post_type' => "specialt",
           'post_status' => 'publish'
        );
        $posts = get_posts ($args);//echo "<pre>";print_r($posts);echo "</pre>";
		foreach($posts as $post){
			
			$terms =  wp_get_object_terms($post->ID, 'specialtcat');
			$postcollect = get_post_meta($post->ID,'_postcollect',true);
			$postcollect = $postcollect?$postcollect:0;
			$img = get_the_post_thumbnail( $post->ID, array(64, 64), array('alt'=>$post->post_title) )?get_the_post_thumbnail( $post->ID, array(64, 64), array('alt'=>$post->post_title,'id'=> "imghead") ):'<img border="0" id="imghead" src="http://static.hdslb.com/images/transparent.gif">';
       ?> 
      <li> 
      <a target="_blank" href="<?php echo get_permalink($post->ID);?>"><?php echo $img;?>
        <div class="t"><?php echo $post->post_title;?> <span>(<?php echo $post->post_title;?>)</span><?php if($terms){?><b>番剧</b><?php }?></div>
        </a>
        <div class="info"><?php echo mb_strimwidth(get_the_title(), 0, 260,"..."); ?></div>
        <div class="date">创建日期:<i><?php echo $post->post_date;?></i> 更新日期:<i><?php echo $post->post_modified;?></i><b><?php echo $postcollect;?></b>人收藏</div>
      </li>
      
      <?php } ?>
    </ul>
  </div>
<!--   <div class="pagelistbox">
        <span>共 77 页/ 1534 个专题 </span>
        <a href="/list/sp-1.html" class="indexPage">首页 </a> 
        <strong>1</strong>
        <a href="/list/sp-2.html">2</a>
        <a href="/list/sp-3.html">3</a> 
        <a href="/list/sp-4.html">4</a> 
        <a href="/list/sp-5.html">5</a>
        <a href="/list/sp-6.html">6</a>
        <a href="/list/sp-7.html">7</a>
        <a href="/list/sp-8.html">8</a>
        <a href="/list/sp-9.html">9</a>
        <a href="/list/sp-10.html">10</a> 
        <a href="/list/sp-11.html">11</a>
        <a href="/list/sp-2.html" class="nextPage">下页</a>
        <a href="/list/sp-77.html" class="endPage">末页</a>
        <input type="text" u="/list/sp-[PAGE].html" class="custompage">
        <a onclick="window.location=$(this).parent().find('.custompage').attr('u').replace('[PAGE]',$(this).parent().find('.custompage').val())" class="button">确定</a>
    </div>
-->    
</div>

<div class="small right"> 
  <div class="z-r">
    <div class="hd">
      <div class="hdt">推荐关注专题</div>
    </div>
    <div class="center">
      <ul id="rup_sp" class="ruplist zt">
        <li><a href="/sp/命运石之门"><img title="命运石之门" src="http://i0.hdslb.com/sp/35/3559ceb2b3b9c8fad96abd2d8f5013be_s.jpg">
          <div class="name">命运石之门</div>
          </a>
          <p class="i"><b>92</b>个视频</p>
          <div class="info">同义词:シュタインズ・ゲート,Steins Gate,STEINS;GATE</div>
        </li>
      </ul>
      <div class="more"><span>每位用户都可创建专题</span></div>
    </div>
  </div>
</div>

<div style="clear:both;"></div>
<?php get_footer(); ?>